home *** CD-ROM | disk | FTP | other *** search
- Subject: Re:
- Sent: 6/11/96 12:20 PM
- Received: 6/11/96 12:31 PM
- From: Serge Froment, sfroment@odyssee.net
- Reply-To: ODF Interest, ODF-Interest@CILabs.ORG
- To: OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
-
- >If you use a TextReader the code would look something like this:
- > FW_CMemoryReader* reader = FW_NEW(FW_CMemoryReader, (bufferPtr,
- >numberOfBytes));
- > while (reader->GetPosition() < reader->GetByteCount())
- > {
- > FW_LChar ch = reader->GetCharacterAndAdvance();
- > if (ch == chTab) ...
- > }
-
- Mary,
-
- If I want to copy from a text reader to a string, would the following loop
- be both OK and efficient?
-
- FW_CString string;
- while (reader->GetPosition() < reader->GetByteCount)
- {
- FW_LChar ch = reader->GetCharacterAndAdvance();
- string.Append(ch);
- if (ch == chTab || ch == chReturn)
- break;
- }
-
- Also, why do you allocate the reader with the FW_NEW operator instead of
- allocating it on the stack?
-
- Serge
-
-